/*
 * Copyright 2006 Matt Jensen
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 */
package org.spectaql;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.spectaql.internal.SpectaqlContextBuilderImpl;

/**
 * <p>
 * <code>Spectaql</code> is the main Spectaql API class. Its primary purpose is to create and configure the
 * {@link SpectaqlContext} instance(s) through which the application will interact with the library.
 * </p>
 * <p>
 * <strong>Thread Safety:</strong> This class provides static helper methods and holds no internal state, and therefore
 * is safe for concurrent access.
 * </p>
 */
public class Spectaql
{
    private static Log LOG = LogFactory.getLog(Spectaql.class);

    /**
     * <p>
     * Construct a {@link Spectaql} instance.
     * </p>
     */
    private Spectaql()
    {
        super();
    }

    /**
     * <p>
     * Get a {@link SpectaqlContextBuilder} instance suitable for creating and configuring a new {@link SpectaqlContext}
     * instance. 
     * </p>
     *
     * @return {@link SpectaqlContextBuilder} instance.
     */
    public static SpectaqlContextBuilder buildContext()
    {
        final SpectaqlContextBuilder result = new SpectaqlContextBuilderImpl();
        if (LOG.isDebugEnabled())
        {
            LOG.debug(String.format("Returning new context builder [%s].", result));
        }
        return result;
    }
}
